function model = im2vec_model(model)
% IM2VEC_MODEL Convert image model to vector model
%
if isfield(model,'amp')
    if ~isfield(model,'ix')
        [model.ix,model.iy] = find(ones(model.reso));
        model.pvec = [model.amp(:); model.exp(:)].';
    else
        vec_ind = model.ix+model.reso*(model.iy-1);
        model.pvec = [model.amp(vec_ind') model.exp(vec_ind')];
    end
    model = rmfield(model,['amp','exp']);
end